﻿<?xml version="1.0" encoding="utf-8" ?>
<Rules FriendlyName="Receivers">

  <Rule>
    <TypeName>SpCop.General.Receivers.FeatureReceiversExists</TypeName>
    <Name>Feature receiver type exists</Name>
    <CheckId>WSP0031</CheckId>
    <Category>Receivers</Category>
    <Resolution Name="ReceiverNotFound">The type '{0}' referenced as feature receiver for feature '{1}' was not found.</Resolution>
    <Resolution Name="UnableToResolve">Unable to resolve a type to analyse feature reaceiver statements '{0}'.</Resolution>
    <MessageLevel Certainty="95">CriticalError</MessageLevel>
    <FixCategories>Breaking</FixCategories>
    <ProductVersion>SharePoint2007, SharePoint2010</ProductVersion>
  </Rule>
  <Rule>
    <TypeName>SpCop.General.Receivers.SiteOrWebFeatureReceiversShouldNotAccessUpperScopes</TypeName>
    <Name>Site Or Web FeatureReceivers should not access upper scopes.</Name>
    <CheckId>WSP0032</CheckId>
    <Category>Scopes</Category>
    <Resolution Name="IsAbusingScopeLevel">The feature '{0}' is set to scope : {1} and is accessing a member that is of a higher scope.</Resolution>
    <MessageLevel Certainty="95">CriticalError</MessageLevel>
    <FixCategories>Breaking</FixCategories>
    <ProductVersion>SharePoint2007, SharePoint2010</ProductVersion>
  </Rule>
  <Rule>
    <TypeName>SpCop.General.Receivers.FeatureReceiversShouldNotUseElevations</TypeName>
    <Name>Feature receivers should not use priviledge elevations</Name>
    <LongDescription>Feature receivers are generally activated on administration screens (Manage Features Page) this means they are admin of the scope at which the feature is to be activated.
    If you are editing data on behalf of or doing other weird things you may ignore this message, but try to find another method that does not require this action.</LongDescription>
    <CheckId>WSP0033</CheckId>
    <Category>Receivers</Category>
    <Resolution Name="UsingElevation">The receiver attached to feature '{0}' uses priviledge elevation in the method '{1}'.</Resolution>
    <Resolution Name="UnableToResolve">Unable to resolve a type to analyse feature reaceiver statements '{0}'.</Resolution>
    <MessageLevel Certainty="95">Warning</MessageLevel>
    <FixCategories>Breaking</FixCategories>
    <ProductVersion>SharePoint2007, SharePoint2010</ProductVersion>
  </Rule>
</Rules>
